<%@ page language="java" import="com.demo.util.Conn,java.sql.ResultSet,java.util.Date,java.text.SimpleDateFormat" pageEncoding="UTF-8"%>
<%
String cid = request.getParameter("cid");
String cname = request.getParameter("cname");
String jid = request.getParameter("jid");
String jct = request.getParameter("jct");
String user_id = "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");

if (session.getAttribute("user_id") == null) {
	response.sendRedirect("../login.jsp?errmsg=login please");
	return;
}
else
	user_id  = session.getAttribute("user_id").toString();

String sql = "insert into dbf_application_info(user_id,company_id,company_name,job_id,job_create_time,application_date) values (" 
			+ user_id + "," 
			+ cid + ",'" 
			+ cname + "',"
			+ jid + ",'"
			+ jct + "','"
			+ sdf.format(new Date()) + "')";
Conn conn = new Conn();
boolean result = conn.update(sql);
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>page</title>
  </head>
  
  <body>
  	<table border="0" cellSpacing=0 cellPadding=0 width="100%">
  		<tr>
  			<td align="center">
  				职位申请<strong><%=result==true ? "成功！" : "失败！" %></strong>&nbsp;&nbsp;
  				<a href="psearch.jsp">返回</a>
  			</td>
  		</tr>
    </table>
  </body>
</html>
